Skip to content

Fix bugs regarding substitution groups and content extensions using xs:all#54

Open
cobizobi wants to merge 2 commits intoapache:masterfrom
cobizobi:cobizobi-fix
Open

Fix bugs regarding substitution groups and content extensions using xs:all#54
cobizobi wants to merge 2 commits intoapache:masterfrom
cobizobi:cobizobi-fix

Conversation

@cobizobi
Copy link
Copy Markdown

@cobizobi cobizobi commented May 18, 2024

I have come across two bugs for which I provide basic fixes here.

  1. If an element with a substitutionGroup did not have an explicit type, an IllegalStateException was thrown because of schemaType == null and !element.isAbstract(). Example:
<xs:element name="any" type="SimpleLiteral" abstract="true"/>
<xs:element name="title" substitutionGroup="any"/>

Here, the exception occurred when walking through the title element. My fix now considers the type of the substitutionGroup element if no explicit is given.

  1. A ClassCastException happened when a particle of type xs:all occurred in an xs:extension, e.g.
<xs:complexContent>
	<xs:extension base="baseType">
		<xs:all> ...

I added a simple check and add the xs:all items to the constructed sequence separately.

@cobizobi
Copy link
Copy Markdown
Author

Would be very nice if someone could take a look at this.

@coheigea
Copy link
Copy Markdown
Contributor

@cobizobi If you're still there, would it be possible to add tests for these changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants